package net.intidee.bean.session.persistenza;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import net.inteidee.bean.businessinterface.GenericDao;
import net.inteidee.bean.businessinterface.UtenteDao;
import net.inteidee.bean.entity.Applicazione;
import net.inteidee.bean.entity.Utente;



@Stateless
public class UtenteDaoImpl extends GenericDaoImpl<Utente>  implements UtenteDao{

	
	public UtenteDaoImpl() {

		super(Utente.class);
	}
	

	public Utente findByUsername(String username){
		
		 
		 Utente utente = (Utente) em.createQuery("from Utente where email='"+username+"'").getSingleResult();
		 //em.close();
		
		return  utente;
	}


	
	

	

}
